package com.cqhfan.chatroom.domain.po;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;

import com.cqhfan.chatroom.enums.SexType;
import com.cqhfan.chatroom.enums.UserStatus;
import com.cqhfan.common.utils.DateUtils;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 用户表
 * </p>
 *
 * @author 眭传洪
 * @since 2024-11-14
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("user")
public class User implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    @JsonSerialize(using = ToStringSerializer.class)
    @Schema(name = "用户id")
    private Long id;

    @Schema(name = "用户名")
    private String userName;

    @Schema(name = "昵称")
    private String nickname;

    @Schema(name = "密码")
    private String password;

    @Schema(name = "性别 0男1女")
    private SexType sex;

    @Schema(name = "电话号码")
    private String phoneNumber;

    @Schema(name = "随机盐")
    private String salt;

    @Schema(name = "头像")
    private String avatar;

    @Schema(name = "注册时间")
    @JsonFormat(pattern = DateUtils.DEFAULT_DATE_TIME_FORMAT)
    private LocalDateTime registerTime;

    @Schema(name = "注册ip")
    private String registerIp;

    @Schema(name = "用户状态 0未停用 1已停用")
    private UserStatus status;


}
